/*
 * @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @Date: 2023-09-16 08:23:25
 * @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @LastEditTime: 2023-09-23 08:41:07
 * @FilePath: \go2023\cmd\day02\if-else\main.go
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
package main

import (
	"github.com/gin-gonic/gin"
	"sxk.games/m/v2/cmd/day02/hello-web/controller"
)

func main() {

	//创建一个路由
	r := gin.Default()

	//绑定路由规则
	r.GET("/", controller.Root)
	r.GET("/json", controller.Json)
	r.GET("/redirect", controller.Redirect)

	//请求地址：http://localhost:8080/login?userName=admin&password=123456
	r.GET("/login", controller.Login)

	//监听8080端口
	r.Run(":8081")
}
